/**
 * @Author: jichang
 * @Date: 2024/10/28 14:48:17
 * @LastEditors: jichang
 * @LastEditTime: 2024/10/28 14:48:17
 * Description: 
 * 接收方：等待队列中的消息
 * 检查消息类型是否与所等待的消息类型匹配
 */
#pragma once
#include "simple_msg_queue.hpp"
#include "sender.hpp"
#include "dispatcher.hpp"

namespace messaging
{
    class receiver {
    public:
        // 允许将类中的队列隐式转换为一个sender队列
        // operator用于类型转换
        operator sender() {
            return sender(&q);
        }
        dispatcher wait() {
            return dispatcher(&q);
        }
    private:
        queue q;
    };
}
